More Sound Static Handling of Java Reflection
نویسندگان
چکیده
Reflection is a highly dynamic language feature that poses grave problems for static analyses. In the Java setting, reflection is ubiquitous in large programs. Any handling of reflection will be approximate, and overestimating its reach in a large codebase can be catastrophic for precision and scalability. We present an approach for handling reflection with improved empirical soundness (as measured against prior approaches and dynamic information) in the context of a points-to analysis. Our approach is based on the combination of string-flow and points-to analysis from past literature augmented with (a) substring analysis and modeling of partial string flow through string builder classes; (b) new techniques for analyzing reflective entities based on information available at their use-sites. In experimental comparisons with prior approaches, we demonstrate a combination of both improved soundness (recovering the majority of missing call-graph edges) and increased performance.
منابع مشابه
Axiomatic Semantics for Java in Isabelle/HOL
We introduce a Hoare-style calculus for a nearly full subset of sequential Java, which we call Java. In particular, we present solutions to challenging features like exception handling, static initialization of classes and dynamic binding of methods. This axiomatic semantics has been proved sound and complete w.r.t. pour operational semantics of Java, described in earlier papers. To our knowled...
متن کاملImproving the Static Resolution of Dynamic Java Features
In Java software, two important flexibility mechanisms are dynamic class loading and reflection. Unfortunately, the vast majority of static analyses for Java handle these features either unsoundly or overly conservatively. Our work targets techniques that will increase static analyses’ ability to handle dynamic features in a more precise
متن کاملSound Control-Flow Graph Extraction for Java Programs with Exceptions
We present an algorithm to extract control-flow graphs from Java bytecode, considering exceptional flows. We then establish its correctness: the behavior of the extracted graphs is shown to be a sound over-approximation of the behavior of the original programs. Thus, any temporal safety property that holds for the extracted control-flow graph also holds for the original program. This makes the ...
متن کاملReflection Support: Java Reflection Made Easy
Large software projects often require the ability to load and manage new code assets that were not originally available during system compilation. Moreover, testing tools need to inspect and run code components regardless of their structures. Reflection in Java supports these tasks by providing programmers with facilities to dynamically create objects, invoke methods, access fields, and perform...
متن کاملReflection Analysis for Java
Reflection has always been a thorn in the side of Java static analysis tools. Without a full treatment of reflection, static analysis tools are both incomplete because some parts of the program may not be included in the application call graph, and unsound because the static analysis does not take into account reflective features of Java that allow writes to object fields and method invocations...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2015